package com.ruoyi.binance.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.binance.mapper.BinanceTransactionOrderMapper;
import com.ruoyi.binance.domain.BinanceTransactionOrder;
import com.ruoyi.binance.service.IBinanceTransactionOrderService;

/**
 * 交易订单Service业务层处理
 * 
 * @author zq
 * @date 2025-08-06
 */
@Service
public class BinanceTransactionOrderServiceImpl implements IBinanceTransactionOrderService 
{
    @Autowired
    private BinanceTransactionOrderMapper binanceTransactionOrderMapper;

    /**
     * 查询交易订单
     * 
     * @param id 交易订单主键
     * @return 交易订单
     */
    @Override
    public BinanceTransactionOrder selectBinanceTransactionOrderById(Long id)
    {
        return binanceTransactionOrderMapper.selectBinanceTransactionOrderById(id);
    }

    /**
     * 查询交易订单列表
     * 
     * @param binanceTransactionOrder 交易订单
     * @return 交易订单
     */
    @Override
    public List<BinanceTransactionOrder> selectBinanceTransactionOrderList(BinanceTransactionOrder binanceTransactionOrder)
    {
        return binanceTransactionOrderMapper.selectBinanceTransactionOrderList(binanceTransactionOrder);
    }

    /**
     * 新增交易订单
     * 
     * @param binanceTransactionOrder 交易订单
     * @return 结果
     */
    @Override
    public int insertBinanceTransactionOrder(BinanceTransactionOrder binanceTransactionOrder)
    {
        binanceTransactionOrder.setCreateTime(DateUtils.getNowDate());
        return binanceTransactionOrderMapper.insertBinanceTransactionOrder(binanceTransactionOrder);
    }

    /**
     * 修改交易订单
     * 
     * @param binanceTransactionOrder 交易订单
     * @return 结果
     */
    @Override
    public int updateBinanceTransactionOrder(BinanceTransactionOrder binanceTransactionOrder)
    {
        binanceTransactionOrder.setUpdateTime(DateUtils.getNowDate());
        return binanceTransactionOrderMapper.updateBinanceTransactionOrder(binanceTransactionOrder);
    }

    /**
     * 批量删除交易订单
     * 
     * @param ids 需要删除的交易订单主键
     * @return 结果
     */
    @Override
    public int deleteBinanceTransactionOrderByIds(Long[] ids)
    {
        return binanceTransactionOrderMapper.deleteBinanceTransactionOrderByIds(ids);
    }

    /**
     * 删除交易订单信息
     * 
     * @param id 交易订单主键
     * @return 结果
     */
    @Override
    public int deleteBinanceTransactionOrderById(Long id)
    {
        return binanceTransactionOrderMapper.deleteBinanceTransactionOrderById(id);
    }
}
